package com.cby.android.sample.repository.api

import com.cby.android.library.remote.RetrofitManager


object ApiSource {

    /**
     * meta 图片地址
     */
    private const val BASE_HOST_IMAGE_URL= "https://image.so.com"

    /**
     * 玩Android 开放API 地址
     */
    private const val BASE_WAN_ANDROID_URL = "https://www.wanandroid.com"


    /**
     * roll Api
     */
    private const val BASE_ROLL_TOOLS_URL = "https://www.mxnzp.com"

    const val ROLL_TOOLS_APP_ID = "limrkcszjfgxamkt"
    const val ROLL_TOOLS_APP_SECRET = "ZGVJUm5PbjJ1NFE4SjFqMzJ0STdwZz09"


    /**
     * 心知 天气开放API 地址
     */
    private const val BASE_XIN_ZHI_URL = "https://api.seniverse.com"

    const val XIN_ZHI_APP_SECRET = "SGlQM8jGgOKvx3Xo1"

    /**
     * 彩云科技 API
     */
    private const val BASE_CAI_YUN_URL = "https://api.caiyunapp.com"

    const val CAI_YUN_APP_SECRET = "pyKtcjONpEwWt6MP"

    /**
     * 天行
     */
    private const val BASE_TIAN_XING_URL = "http://api.tianapi.com"

    const val TIAN_XING_API_KEY = "38828dc957c90acf97d2079c07dc266e"

    /**
     * 针对meta的接口地址的api获取
     *
     * @param service Class<T>
     * @return T
     */
    fun <T> getMetaService(service: Class<T>): T =
        RetrofitManager.getService(service, BASE_HOST_IMAGE_URL)



    /**
     * 针对玩Android 开放API获取
     *
     * @param service Class<T>
     * @return T
     */
    fun <T> getWanAndroidService(service: Class<T>): T =
        RetrofitManager.getService(service, BASE_WAN_ANDROID_URL)

    /**
     * roll API 接口
     *
     * @param service Class<T>
     * @return T
     */
    fun <T> getRollService(service: Class<T>): T =
        RetrofitManager.getService(service, BASE_ROLL_TOOLS_URL)

    /**
     * 心知 天气开放API 接口
     *
     * @param service Class<T>
     * @return T
     */
    fun <T> getXinZhiWeatherService(service: Class<T>): T =
        RetrofitManager.getService(service, BASE_XIN_ZHI_URL)

    /**
     * 彩云 天气开放API 接口
     *
     * @param service Class<T>
     * @return T
     */
    fun <T> getCaiYunWeatherService(service: Class<T>): T =
        RetrofitManager.getService(service, BASE_CAI_YUN_URL)

    /**
     * 天行 开放API 接口
     *
     * @param service Class<T>
     * @return T
     */
    fun <T> getTianXingService(service: Class<T>): T =
        RetrofitManager.getService(service, BASE_TIAN_XING_URL)
}